<html>
    <head>
        <title>simple-squid-ncsa-user-manager</title>
    </head>
    <body>
        <center>
            <b>simple-squid-ncsa-user-manager</b>
        </center>
        <br>

        <?php
            include "./squidcommon.php";

            $result = get_user_data($squid_database);
            
            echo '<table border="1" width="100%">';
                echo '<tr>';
                    echo '<td style="vertical-align: middle; text-align: center">';
                        echo '<form method="post" action="./squiduseradd.php">';
                        echo '<input type="text" name="username" size="21" maxlength="64" value="usename">';
                        echo '<input type="password" name="password" size="21" maxlength="64" value="password">';
                        echo '<input type="text" name="comments" size="21" maxlength="128" value="Новый пользователь">';
                        echo '<input type="submit" name="useradd" value="' . $add_user_button . '">';
                        echo '</form>';
                    echo '</td>';
                echo '</tr>';
            echo '</table>';
            echo '<table border="1" width="100%">';
                echo '<form method="post" action="./squiduserdel.php">';
                    while ($row = $result -> fetchArray()) {
                        echo '<tr>';
                        echo '<td>';
                        echo '<input name="userdel_radio" type="radio" value="' . $row["username"] . '">';
                        echo '</td>';
                        echo '<td>';
                        echo $row["username"];
                        echo '</td>';
                        echo '<td>';
                        echo $row["password"];
                        echo '</td>';
                        echo '<td>';
                        echo $row["comments"];
                        echo '</td>';
                        echo '<td>';
                        echo '<input type="submit" name="' . $row["username"] . '" value="' . $delete_user_button . '">';
                        echo '</td>';
                        echo '</tr>';
                    }
                echo '</form>';
            echo '</table>';
            echo '<br>';
            echo '<center>';
                echo '<img src="./img/yoba.jpg" alt="mr.Y.O.B.A."></img>';
            echo '</center>';
        ?>
    </body>
</html>
